UCAAS-1446 C++ InvokeContext runtime tests and ROSE ownership hardening#137
Merged
JanFellner merged 10 commits intoJul 8, 2026
Merged
Conversation
Tests define expected public API behavior; never tune test or product code to go green unless explicitly asked.
Adds 43 spec tests for custom SnaccInvokeContext on inbound and outbound ROSE paths including failure and orphan scenarios. Test harness uses snapshot-based observation at handler and transport callbacks. 39 pass and 4 fail against current runtime behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
C++ codegen now sets choiceId only after the selected arm decodes successfully, so failed envelope decodes leave a cleared choice. Regenerate SNACCROSE from the updated generator. Co-authored-by: Cursor <cursoragent@cursor.com>
…code. Only emit mistypedArgument rejects after ROSEMessage decoding succeeds and a real invoke is available. Unparsable BER or JSON wire is logged and telemetried without sending an uncorrelated invokednull reject, matching common RPC practice for garbage framing. Move envelope decode and OnROSEMessage into the same guarded try on OnBinaryDataBlockResult so bRoseEnvelopeDecoded reflects actual decode state on both inbound paths. Expect ROSE_TE_TIMEOUT (not ROSE_TE_TRANSPORTFAILED) when a client invoke never receives a server response; transport failure remains for failed caller-side sends only.
Move ROSEMessage ownership through the decode and dispatch path with unique_ptr, snapshot invoke fields for decode-failure rejects, and align the C++ generator and runtime harness with the updated OnInvoke and sub-message APIs. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace manual prevent-delete nulling in Send/EncodeResult/EncodeError/EncodeReject with RAII helpers, add living-documentation guidance, and align header and correctness-note docs with unique_ptr ownership. Co-authored-by: Cursor <cursoragent@cursor.com>
Move shared OnBinaryDataBlock decode-failure handling onto SnaccROSEBase and sync runtime_correctness_notes with implemented semantics. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Use const references and pointers for borrow-only envelopes and payloads, with documented in-place BER JSON logging grafts that restore the owned message.
Use p-prefix names for AsnType and ROSE invoke/reject pointers across runtime interfaces and implementations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
C++ runtime work for UCAAS-1446. TypeScript gluecode parity is out of scope for this story (separate ticket if needed later).
InvokeContextRuntimeTestcases (BER + JSON); 113/113 totalcpp-lib-sample-runtime-testspassing locally.choiceIduntil decode succeeds, gate decode rejects on successful envelope decode, adoptunique_ptrownership through dispatch.p-prefixed pointer naming on ROSE stub/runtime APIs.SnaccROSEBasemethods.cpp-lib/tests/runtime_correctness_notes.md(invoke-context lifecycle, ownership, telemetry semantics).Not in this PR
Exploratory ROSE send API pointer refactors (
takeInvoke,SnaccScopedInvokeMessage&&, etc.) were tried locally and reverted — branch keeps simpleROSEInvoke*borrow semantics forSendInvoke/SendEvent.Test plan
cpp-lib-sample-runtime-tests— 113/113 passed locally0096ff9)OnInvoke(std::unique_ptr&)stub shape for downstream consumersJira
https://jira.estos.de/browse/UCAAS-1446